<template>
    <div>
        <el-card shadow="never" class="!border-none">
            <el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleTabClick">
                <el-tab-pane label="发布" name="first"><release @callVersionMethod="callVersionMethod"></release></el-tab-pane>
                <el-tab-pane label="版本管理" name="second"><version ref="versionComponent"></version></el-tab-pane>
                <el-tab-pane label="配置" name="third"><configuration></configuration></el-tab-pane>
            </el-tabs>
        </el-card>
    </div>
</template>

<script lang="ts" setup name="managementEdit">
import release from './release.vue'
import version from './version.vue'
import configuration from './pz.vue'

const activeName = ref('first')
const versionComponent = shallowRef()


const handleTabClick = (tab: any) => {
    if (tab.props.name == 'second') {
        callVersionMethod()
    }
}

const callVersionMethod = () => {
    activeName.value = 'second'
    versionComponent.value?.someMethodInVersion()
}
</script>

